package cc.magicjson.openapi.interfaces.rest;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
//@Tag(name = "问候控制器", description = "用于演示基本的 API 文档")
public class HelloController {


    /**
     * 获取问候消息
     * @param name 要问候的人的名字
     * @return 问候消息
     */
//    @Operation(summary = "获取问候消息", description = "根据提供的名字返回个性化的问候")
    @GetMapping("/hello")
    public String hello(
//            @Parameter(description = "要问候的人的名字")
            @RequestParam(value = "name", defaultValue = "世界") String name) {
        return String.format("你好，%s！", name);
    }
}